\section{JEdifDetectionSelection}
JEdifDetectionSelection determines detector locations for both triplicated and
duplicated design portions using user-specified options. Like
JEdifNMRSelection, this tool is designed to be run in multiple passes
(only one replication type can be processed per pass). Results are
saved in the replication description (.rdesc) file.

JEdifDetectionSelection is capable of inserting both single- and dual-rail
detectors. By default, output registers and output buffers are placed at detection signal
outputs, but this behavior can be disabled (i.e. if the design being replicated
is not a top-level design).

At times, the user may wish to force detection on certain nets and prevent
detector insertion on others. This can be accomplished by inserting
\texttt{`force\_detect'} and \texttt{`do\_not\_detect'} properties on selected
nets in the .edf file as follows:\\
\texttt{(property force\_detect (boolean (true)))}\\
\texttt{(property do\_not\_detect (boolean (true)))}\\

\begin{verbatim}
>java edu.byu.ece.edif.jedif.JEdifDetectionSelection
Options:
  [-h|--help]
  [-v|--version]

  <input_file>
  (-r|--rep_desc) <rep_desc>
  (-c|--c_desc) <c_desc>

  --replication_type <replication_type>
  [--rail_type <rail_type>]
  (-p|--port_name) <port_name>
  [--no_downscale_detection]
  [--no_upscale_detection]
  [--no_output_detection]
  [--no_obufs]
  [--no_oregs]
  [--clock_net <clock_net>]
 
  [--write_config <config_file>]
  [--use_config <config_file>]

  [--log <logfile>]
  [--debug[:<debug_log>]]
  [(-V|--verbose) <{1|2|3|4|5}>]
  [--append_log]
\end{verbatim}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{File Options}

\subsubsection{\texttt{<input\_file>}}
Filename and path to the .jedif source file.

\subsubsection{\texttt{(-r|--rep\_desc) <rep\_desc>}}
Filename and path to the replication description (.rdesc) file to be modified.

\subsubsection{\texttt{(-c|--c\_desc) <c\_desc>}}
Filename and path to the circuit description (.cdesc) file generated by
JEdifAnalyze.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Detection Options}

\subsubsection{\texttt{--replication\_type <replication\_type>}}
Replication type to use for the current pass. Must be one of the following:
\texttt{triplication}, \texttt{duplication}.

\subsubsection{\texttt{--rail\_type <rail\_type>}}
Rail type. Must be one of the following: \texttt{single}, \texttt{dual}. The
default rail type is \texttt{single}. Single-rail detectors produce a $1$-bit
error code that is high when an error is detected. A dual-rail detector produces
a $2$-bit error code output that enables detection of comparator errors. The
`\texttt{$00$}' code indicates that no error has been detected. The
`\texttt{$11$}' code indicates that an error has been detected. The
`\texttt{$01$}' and `\texttt{$10$}' codes indicate that a comparator error has
been detected.

\subsubsection{\texttt{(-p|--port\_name) <port\_name>}}
Name of the port that should receive the detection error signals. If a port
with this name does not exist, it will be created. If the given port already
exists, it must have the correct bit-width ($1$ for single-rail detection, $2$
for dual-rail detection) or an error will occur. JEdifDetectionSelection may be
run multiple times with different port names or with the same port name. The
results of all runs with the same port name will be merged into the port.

\subsubsection{\texttt{--no\_downscale\_detection}}
This option disables the default behavior of inserting detectors at locations
where the replication factor downscales (i.e. data flows from a triplicated
partition to a duplicated partition).

\subsubsection{\texttt{--no\_upscale\_detection}}
This option disables the default behavior of inserting detectors at locations
where the replication factor upscales (i.e. data flows from a duplicated
partition to a triplicated partition).

\subsubsection{\texttt{--no\_output\_detection}}
This option disables the default behavior of inserting detectors at circuit
outputs.

\subsubsection{\texttt{--no\_obufs}}
This option disables the default behavior of inserting output buffers on the
detection error signal outputs. This could be useful if the tool is not
operating on a top-level design.

\subsubsection{\texttt{--no\_oregs}}
This option disables the default behavior of inserting output registers on the
detection error signal outputs.

\subsubsection{\texttt{--clock\_net <clock\_net>}}
This option specifies a clock net to use for output registers. This option is
required unless output register insertion is disabled with the
\texttt{--no\_oregs} option. The name given should be the name of the clock net
\emph{after} replication (if the clock is to be replicated).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\input{option_ConfigFile}
\input{option_Logfile}
